package basic50.fortieth;

import java.util.Arrays;
import java.util.Scanner;

public class Basic34 {
    public static void main(String[] args) {
        //题目：输入3个数a,b,c，按大小顺序输出。
        //程序分析：利用指针方法。
        Scanner in = new Scanner(System.in);
        System.out.println("Enter  integer: ");
        int[] arr = new int[3];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = in.nextInt();
        }
        sort(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static void sort(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            for (int j = i + 1; j < arr.length; j++) {
                if (arr[i] > arr[j]) {
                    int temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;
                }
            }
        }
    }
}
